						<?php
							foreach($setting->result_array() as $row){
									$$row['name'] = $row['value'];
							}
							
							function account_list($account, $id=0){
								$exp = explode(",",$id);
								foreach($account as $row){
									foreach($row as $key=>$parent){
									
										if($key == 'data'){
											echo "<option value=\"".$parent['akun_id']."\" ".(in_array($parent['akun_id'], $exp)?'selected="selected"':'')." >".$parent['kode_akun']." - ".$parent['nama']."</option>";
										}else if($key == 'sub'){
											if(count($parent) > 0){
												account_list($parent,$id);
											}
										}
									}
								}
							}
						?>
						<div class="heading">

							<h3>Pengaturan Sistem</h3>                    

							<div class="resBtnSearch">
								<a href="#"><span class="icon16 icomoon-icon-search-3"></span></a>
							</div>
							
							<ul class="breadcrumb">
								<li>Anda berada di:</li>
								<li>
									<a href="#" class="tip" title="back to dashboard">
										<span class="icon16 icomoon-icon-screen-2"></span>
									</a> 
									<span class="divider">
										<span class="icon16 icomoon-icon-arrow-right-2"></span>
									</span>
								</li>
								<li>
									Pengaturan 
									<span class="divider">
										<span class="icon16 icomoon-icon-arrow-right-2"></span>
									</span>
								</li>
								<li class="active">Sistem</li>
							</ul>

						</div><!-- End .heading-->
						<div class="row-fluid">

							<div class="span12">
								<div class="centerContent">
									<div class="box">

										<div class="title">
											<h4>
												<span class="icon16 icomoon-icon-grid"></span>
												<span>Form Sistem</span>
											</h4>
										</div>
										<div class="content noPad">
											<form id="form-setting" class="form-horizontal" action="" method="post">
												<ul class="nav nav-tabs" id="tab">
													<li class="active"><a href="#site">Website</a></li>
													<li><a href="#perusahaan">Data Perusahaan</a></li>
													<li><a href="#agent">Keagenan</a></li>
													<li><a href="#acc-maskapai">Pembukuan Maskapai</a></li>
													<li><a href="#acc-bank">Pembukuan Bank</a></li>
													<li><a href="#acc-lain">Pembukuan Lain</a></li>
												</ul>
												<div class="tab-content">
													<div class="tab-pane active" id="site">
														<div class="form-row row-fluid">
															<div class="span12">
																<div class="span12">
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="site_offline">Site Offline:</label>
																				<div class="left marginR10">
																					<input type="checkbox" id="site_offline" <?php echo $site_offline=='yes'?'checked="checked"':''?> class="ibutton nostyle" value="1" name="data[site_offline]" />
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="system_name">Nama Sistem:</label>
																				<input type="text" id="system_name" class="span8 text" value="<?php echo isset($system_name)?$system_name:''?>" name="data[system_name]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="system_description">Deskripsi Sistem:</label>
																				<input type="text" id="system_description" class="span8 text" value="<?php echo isset($system_description)?$system_description:''?>" name="data[system_description]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="system_keyword">Keyword Sistem:</label>
																				<input type="text" id="system_keyword" class="span8 text" value="<?php echo isset($system_keyword)?$system_keyword:''?>" name="data[system_keyword]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="interval_notif">Interval Notif:</label>
																				<input type="text" id="interval_notif" class="span8 text" value="<?php echo isset($interval_notif)?$interval_notif:'10000'?>" name="data[interval_notif]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="interval_chat">Interval Chat:</label>
																				<input type="text" id="interval_chat" class="span8 text" value="<?php echo isset($interval_chat)?$interval_chat:'10000'?>" name="data[interval_chat]" />
																			</div>
																		</div>
																	</div>
																</div>
															</div> 
														</div>
													</div>
													<div class="tab-pane" id="perusahaan">
														<div class="form-row row-fluid">
															<div class="span12">
																<div class="span12">
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_name">Nama Perusahaan:</label>
																				<input type="text" id="company_name" class="span8 text" value="<?php echo isset($company_name)?$company_name:''?>" name="data[company_name]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_address">Alamat:</label>
																				<input type="text" id="company_address" class="span8 text" value="<?php echo isset($company_address)?$company_address:''?>" name="data[company_address]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_city">Kota:</label>
																				<input type="text" id="company_city" class="span4 text" value="<?php echo isset($company_city)?$company_city:''?>" name="data[company_city]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_region">Provinsi:</label>
																				<input type="text" id="company_region" class="span4 text" value="<?php echo isset($company_region)?$company_region:''?>" name="data[company_region]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_country">Negara:</label>
																				<input type="text" id="company_country" class="span4 text" value="<?php echo isset($company_country)?$company_country:''?>" name="data[company_country]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_zipcode">Kode Pos:</label>
																				<input type="text" id="company_zipcode" class="span2 text" value="<?php echo isset($company_zipcode)?$company_zipcode:''?>" name="data[company_zipcode]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_phone">Telpon:</label>
																				<input type="text" id="company_phone" class="span4 text" value="<?php echo isset($company_phone)?$company_phone:''?>" name="data[company_phone]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_fax">Fax:</label>
																				<input type="text" id="company_fax" class="span4 text" value="<?php echo isset($company_fax)?$company_fax:''?>" name="data[company_fax]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_email">Email:</label>
																				<input type="text" id="company_email" class="span4 text" value="<?php echo isset($company_email)?$company_email:''?>" name="data[company_email]" />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="company_website">Website:</label>
																				<input type="text" id="company_website" class="span4 text" value="<?php echo isset($company_website)?$company_website:''?>" name="data[company_website]" />
																			</div>
																		</div>
																	</div>
																</div>
															</div> 
														</div>
													</div>
													<div class="tab-pane" id="agent">
														<div class="form-row row-fluid">
															<div class="span12">
																<div class="span12">
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="multi_master">Multi Master:</label>
																				<div class="left marginR10">
																					<input type="checkbox" id="multi_master" <?php echo $multi_master=='yes'?'checked="checked"':''?> class="ibutton nostyle" value="1" name="data[multi_master]" />
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="id_master">Master Utama:</label>
																				<div class="span4 controls">
																					<select id="id_master" name="data[id_master]">
																						<?php foreach($master->result_array() as $row){?>
																						<option value="<?php echo $row['id']?>" <?php echo $id_master == $row['id']?'selected="selected"':''?>><?php echo $row['name']?></option>
																						<?php } ?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid multi" <?php echo $multi_master == 'no'?'style="display:none;"':''?>>
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="total_master">Total Master:</label>
																				<input type="digits" class="span4" id="total_master" name="data[total_master]" value="<?php echo $total_master?>" required />
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="total_agent">Total Agent:</label>
																				<input type="digits" class="span4" id="total_agent" name="data[total_agent]" value="<?php echo $total_agent?>" required />
																			</div>
																		</div>
																	</div>
																</div>
															</div> 
														</div>
													</div>
													<div class="tab-pane" id="acc-maskapai">
													   <div class="form-row row-fluid noPad">
															<div class="span12">
																<div class="span12">
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_kas_komisi">Kas Penjualan & Komisi:</label>
																				<div class="span6 controls">
																					<select id="akun_kas_komisi" name="data[akun_kas_komisi]">
																						<?php $var="akun_kas_komisi";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_deposit_agent">Hutang Deposit Agen:</label>
																				<div class="span6 controls">
																					<select id="akun_deposit_agent" name="data[akun_deposit_agent]">
																						<?php $var="akun_deposit_agent";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_daftar_agent">Pendaftaran Agen:</label>
																				<div class="span6 controls">
																					<select id="akun_daftar_agent" name="data[akun_daftar_agent]">
																						<?php $var="akun_daftar_agent";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_tambahan_issued">Pendapatan Tambahan Issued:</label>
																				<div class="span6 controls">
																					<select id="akun_tambahan_issued" name="data[akun_tambahan_issued]">
																						<?php $var="akun_tambahan_issued";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_pendapatan_topup">Pendapatan Topup:</label>
																				<div class="span6 controls">
																					<select id="akun_pendapatan_topup" name="data[akun_pendapatan_topup]">
																						<?php $var="akun_pendapatan_topup";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_beban_insentif">Bonus Insentif Agen :</label>
																				<div class="span6 controls">
																					<select id="akun_beban_insentif" name="data[akun_beban_insentif]">
																						<?php $var="akun_beban_insentif";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_beban_pendaftaran">Bonus Pendaftaran Agen :</label>
																				<div class="span6 controls">
																					<select id="akun_beban_pendaftaran" name="data[akun_beban_pendaftaran]">
																						<?php $var="akun_beban_pendaftaran";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_piutang_insentif_master">Piutang Insentif Master :</label>
																				<div class="span6 controls">
																					<select id="akun_piutang_insentif_master" name="data[akun_piutang_insentif_master]">
																						<?php $var="akun_piutang_insentif_master";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_piutang_deposit_agent">Piutang Deposit Agent :</label>
																				<div class="span6 controls">
																					<select id="akun_piutang_deposit_agent" name="data[akun_piutang_deposit_agent]">
																						<?php $var="akun_piutang_deposit_agent";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																</div>
															</div>
														</div>
													   <table class="responsive table table-striped table-condensed">
															<thead>
																<tr>
																	<th>Maskapai</th>
																	<th>Deposit</th>
																	<th>HPP</th>
																	<th>Penjualan</th>
																</tr>
															</thead>
															<tbody>
																<?php
																	foreach($airline as $obj){
																?>
																<tr>
																	<td><?php echo $obj->get_nick_name()?></td>
																	<td>
																		<div class="span12 controls">
																			<select id="akun_deposit_maskapai_<?php echo $obj->get_id()?>" name="data[akun_deposit_maskapai_<?php echo $obj->get_id()?>]">
																				<?php $var="akun_deposit_maskapai_".$obj->get_id();$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																			</select>
																		</div>
																	</td>
																	<td>
																		<div class="span12 controls">
																			<select id="akun_hpp_maskapai_<?php echo $obj->get_id()?>" name="data[akun_hpp_maskapai_<?php echo $obj->get_id()?>]">
																				<?php $var="akun_hpp_maskapai_".$obj->get_id();$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																			</select>
																		</div>
																	</td>
																	<td>
																		<div class="span12 controls">
																			<select id="akun_penjualan_maskapai_<?php echo $obj->get_id()?>" name="data[akun_penjualan_maskapai_<?php echo $obj->get_id()?>]">
																				<?php $var="akun_penjualan_maskapai_".$obj->get_id();$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																			</select>
																		</div>
																	</td>
																</tr>
															</tbody>
															<?php } ?>
														</table>
														
														<table class="responsive table table-striped table-condensed">
															<thead>
																<tr>
																	<th>Maskapai</th>
																	<th>Hutang Deposit</th>
																	<th>Insentif</th>
																	<th>Piutang Insentif</th>
																</tr>
															</thead>
															<tbody>
																<?php
																	foreach($airline as $obj){
																?>
																<tr>
																	<td><?php echo $obj->get_nick_name()?></td>
																	<td>
																		<div class="span12 controls">
																			<select id="akun_hutang_deposit_maskapai_<?php echo $obj->get_id()?>" name="data[akun_hutang_deposit_maskapai_<?php echo $obj->get_id()?>]">
																				<?php $var="akun_hutang_deposit_maskapai_".$obj->get_id();$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																			</select>
																		</div>
																	</td>
																	<td>
																		<div class="span12 controls">
																			<select id="akun_insentif_maskapai_<?php echo $obj->get_id()?>" name="data[akun_insentif_maskapai_<?php echo $obj->get_id()?>]">
																				<?php $var="akun_insentif_maskapai_".$obj->get_id();$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																			</select>
																		</div>
																	</td>
																	<td>
																		<div class="span12 controls">
																			<select id="akun_piutang_insentif_maskapai_<?php echo $obj->get_id()?>" name="data[akun_piutang_insentif_maskapai_<?php echo $obj->get_id()?>]">
																				<?php $var="akun_piutang_insentif_maskapai_".$obj->get_id();$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																			</select>
																		</div>
																	</td>
																</tr>
															</tbody>
															<?php } ?>
														</table>
													</div>
													<div class="tab-pane" id="acc-bank">
														<div class="form-row row-fluid noPad">
															<div class="span12">
																<div class="span12">
																	<?php foreach($rekening->result_array() as $row){?>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_kas_komisi">Akun Bank <?php echo $row['bank']?>:</label>
																				<div class="span6 controls">
																					<select id="akun_bank_<?php echo $row['id']?>" name="data[akun_bank_<?php echo $row['id']?>]">
																						<?php $var="akun_bank_".$row['id'];$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																				</div>
																			</div>
																		</div>
																	</div>
																	<?php } ?>
																</div>
															</div>
														</div>
													</div>
													<div class="tab-pane" id="acc-lain">
														<div class="form-row row-fluid noPad">
															<div class="span12">
																<div class="span12">
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_root_pendapatan">Akun Root Pendapatan:</label>
																				<div class="span6 controls">
																					<select id="select1"  multiple="multiple" class="nostyle multi-select" style="width:100%;">
																						<?php $var="akun_root_pendapatan";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																					<input type="hidden" id="akun_root_pendapatan" name="data[akun_root_pendapatan]" value="<?php echo $id_akun?>" />
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_root_kas">Akun Root Kas:</label>
																				<div class="span6 controls">
																					<select id="select2"  multiple="multiple" class="nostyle multi-select" style="width:100%;">
																						<?php $var="akun_root_kas";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																					<input type="hidden" id="akun_root_kas" name="data[akun_root_kas]" value="<?php echo $id_akun?>" />
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_root_beban">Akun Root Beban:</label>
																				<div class="span6 controls">
																					<select id="select3"  multiple="multiple" class="nostyle multi-select" style="width:100%;">
																						<?php $var="akun_root_beban";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																					<input type="hidden" id="akun_root_beban" name="data[akun_root_beban]" value="<?php echo $id_akun?>" />
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_root_hutang">Akun Root Hutang:</label>
																				<div class="span6 controls">
																					<select id="select4"  multiple="multiple" class="nostyle multi-select" style="width:100%;">
																						<?php $var="akun_root_hutang";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																					<input type="hidden" id="akun_root_hutang" name="data[akun_root_hutang]" value="<?php echo $id_akun?>" />
																				</div>
																			</div>
																		</div>
																	</div>
																	<div class="form-row row-fluid">
																		<div class="span12">
																			<div class="row-fluid">
																				<label class="form-label span4" for="akun_root_piutang">Akun Root Piutang:</label>
																				<div class="span6 controls">
																					<select id="select5"  multiple="multiple" class="nostyle multi-select" style="width:100%;">
																						<?php $var="akun_root_piutang";$id_akun = isset($$var)?$$var:0;echo account_list($account,$id_akun)?>
																					</select>
																					<input type="hidden" id="akun_root_piutang" name="data[akun_root_piutang]" value="<?php echo $id_akun?>" />
																				</div>
																			</div>
																		</div>
																	</div>
																</div>
															</div>
														</div>
													</div>
												</div>
												
												<div class="form-row row-fluid">
													<div class="span12">
														<div class="row-fluid">
															<div class="form-actions">
															<div class="span3"></div>
															<div class="span9 controls">
																<button type="submit" class="btn btn-primary marginR10">Simpan</button>
															</div>
															</div>
														</div>
													</div>
												</div>
											</form>
										</div>
									</div>
								</div>
							</div>
						</div>
						<?php $this->load->view('template/messages'); ?>
